require 'test_helper'


class ClientTest < ActiveSupport::TestCase
  test "should not save client without room name" do
    client = Client.create CLIENT_PARAMS_MISSING_ROOM
    assert_predicate client , :new_record?
  end

  test "should not save client with blank room name" do
    client = Client.create CLIENT_PARAMS_BLANK_ROOM
    assert_predicate client , :new_record?
  end

  test "should not save client without nicks CSV" do
    client = Client.create CLIENT_PARAMS_MISSING_NICKS
    assert_predicate client , :new_record?
  end

  test "should not save client with blank nicks CSV" do
    client = Client.create CLIENT_PARAMS_BLANK_NICKS
    assert_predicate client , :new_record?
  end

  test "should not save client without client type" do
    client = Client.create CLIENT_PARAMS_MISSING_TYPE
    assert_predicate client , :new_record?
  end

  test "should not save client with blank client type" do
    client = Client.create CLIENT_PARAMS_BLANK_TYPE
    assert_predicate client , :new_record?
  end

  test "should save client with valid params" do
    client = Client.create CLIENT_PARAMS_VALID
    assert_not_predicate client , :new_record?
    assert_kind_of       Client , client
  end
end
